Skip to content

refactor(advisor): adopt AdvisorDecision scenario, compact scoped tools, and decompose cycle coordinator - #25

Merged
mcocdaa merged 1 commit into
mainfrom
refactor/generic-separation-live-fixes
Nov 21, 2026
Merged

mcocdaa merged 1 commit into
mainfrom
refactor/generic-separation-live-fixes

Conversation

@mcocdaa

@mcocdaa mcocdaa commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Switches strictly to ScenarioIds.AdvisorDecision with compact scoped tools on R1 and tool-free R2; aligns EN/ZH L0 prompts; wraps async context providers with MainThreadSnapshot; removes actions_* hardcoding from ColonyMacroPerceiver; decomposes AdvisorCycleCoordinator into ApprovalSubmissionPipeline, AdvisorDirectExecutionHandler, ToolCallSummaryFormatter, and AdvisorMotePresenter; adopts Core Json/Settings/Cache/Risk helpers. Verified with 48/48 tests and live playthrough (-65.3% Advisor tokens/call).

…ls, and decompose cycle coordinator

refactor(advisor): split cycle coordinator and delegate parsing to Core APIs

Extract direct execution, approval submission, tool-call formatting, and
mote presentation out of AdvisorCycleCoordinator into focused collaborators
(AdvisorDirectExecutionHandler, ApprovalSubmissionPipeline,
ToolCallSummaryFormatter, AdvisorMotePresenter), shrinking the coordinator
to orchestration only.

Delegate LLM output cleaning, JSON extraction/repair, pseudo-function-call
parsing, reason extraction, mote wrapping, and translation fallbacks to the
new Core facade APIs (RimMindAPI.Json/Text/ToolSet/Bus/Request/MainThreadSnapshot),
removing duplicated logic from Advisor.

Register a dedicated AdvisorDecision scenario so Advisor context providers no
longer collide with Core's agent_decision, and route context reads through
MainThreadSnapshot. Scope tool definitions via AdvisorDefaultScope with compact
schemas, and omit tool definitions on round-2 feedback to cut token usage.

Replace the plain-text tool dump in the L3 actions_list with concise native
Tool Calling guidance, update prompt strings (EN/ZH) to reflect schema-driven
arguments and approval autonomy, and drop hardcoded action IDs from colony
bottleneck text. Add WorldScopedComponentCache-backed history store with
reset hooks and expand tests/stubs accordingly.
@mcocdaa
mcocdaa merged commit b238290 into main Nov 21, 2026
@mcocdaa
mcocdaa deleted the refactor/generic-separation-live-fixes branch November 21, 2026 10:40
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant